<!doctype html>
<html lang="en">

    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>
            <g:layoutTitle default="Some Title" /></title>
        <link rel="icon" href="${createLinkTo(dir: 'images', file: 'favicon.ico')}" type="image/x-icon">
        <link rel="shortcut icon" href="${createLinkTo(dir: 'images', file: 'favicon.ico')}" type="image/x-icon" />
        <asset:stylesheet src="homer/vendor/fontawesome/css/font-awesome.min.css" />
        <asset:stylesheet src="homer/fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css"/>
        <asset:stylesheet src="homer/vendor/fontawesome/css/font-awesome.css"/>
        <asset:stylesheet src="homer/vendor/metisMenu/metisMenu.min.css" />
        <asset:stylesheet src="homer/vendor/metisMenu/metisMenu.css" />
        <asset:stylesheet src="homer/vendor/bootstrap/dist/css/bootstrap.css" />
        <asset:stylesheet src="homer/vendor/bootstrap/dist/css/bootstrap.min.css" />
        <asset:stylesheet src="homer/vendor/blueimp-gallery/css/blueimp-gallery.min.css"/>
        <asset:stylesheet src="homer/vendor/highlight/styles/atelier-forest-light.css"/>
        <asset:stylesheet src="homer/vendor/animate.css/animate.min.css" />
        <asset:stylesheet src="homer/vendor/animate.css/animate.css" />
        <asset:stylesheet src="homer/style.css" />
        <asset:stylesheet src="homer/vendor/sweetalert/lib/sweet-alert.css" />
        <asset:stylesheet src="homer/vendor/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" />
        <asset:stylesheet src="homer/vendor/highlight/styles/atelier-seaside-light.css" />
        <asset:stylesheet src="homer/vendor/select2-3.5.2/select2.min.css" />
        <asset:stylesheet src="homer/vendor/select2-3.5.2/select2-bootstrap.css" />
        <asset:stylesheet src="homer/vendor/datetimepicker/bootstrap-datetimepicker.min.css" />
        <asset:stylesheet src="homer/vendor/summernote/summernote.css" />
        <asset:stylesheet src="homer/vendor/toastr/toastr.min.css" />
        <asset:stylesheet src="homer/static_custom.css" />
        <asset:stylesheet src="homer/vendor/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css" />
        <asset:javascript src="homer/vendor/jquery/dist/jquery.min.js" />
        <asset:javascript src="echarts.min.js"/>
        <g:layoutHead/>

        <style type="text/css">
            html {
                height: 100%;
            }

            body {
                font-family: "Microsoft YaHei", "Microsoft Sans Serif", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", sans-serif;
                background-color: #f1f3f6;
            }

            .table {
                margin-bottom: 0;
            }

            .pagination {
                margin: 0 auto;
                text-align: center;
            }

            .pagination a,
            .pagination .currentStep {
                color: #666;
                display: inline-block;
                margin: 0 0.1em;
                padding: 0.25em 0.7em;
                text-decoration: none;
                -moz-border-radius: 0.3em;
                -webkit-border-radius: 0.3em;
                border-radius: 0.3em;
            }

            .pagination a:hover, .pagination a:focus,
            .pagination .currentStep {
                background-color: #999;
                color: #fff;
                outline: none;
                text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
            }

            .panel-tools a i {
                margin-right: 4px;
            }
            .panel-heading .panel-tools a.btn{
                color: #fff;
            }

            .errors{
                display: none;
            }
            .errors li {
                padding: 5px 0;
            }
            .contact-stat span {
                font-size: 13px;
                color: #88898c;
                margin-bottom: 10px;
            }

            .contact-stat strong {
                font-size: 13px;
                word-wrap: break-word;
            }
            .tooltip{
                word-wrap: break-word;
            }

            .form-group span.cont {
                padding-top: 7px;
                margin-bottom: 0;
                display: block;
                font-size: 14px;
                color: #555;
            }


            #side-menu li a i {
                margin-right: 4px;
            }

            #side-menu li a {
                padding: 15px 20px 15px 10px;
            }

            .profile-picture i {
                margin-right: 10px;
            }

            #menu {
                background-color: #fff;
            }

            .new-dropdown {
                min-width: 100px;
            }

            .new-dropdown li i {
                margin-right: 6px;
            }

            .mobile-navbar .navbar-nav > li, .mobile-navbar .navbar-nav > li > a {
                height: 36px;
                line-height: 36px;
            }

            .mobile-navbar .navbar-nav > li > a {
                padding: 0 15px;
                font-size: 13px;
            }

            .dropdown-link {
                height: 56px !important;
                line-height: 56px !important;
                padding: 0 20px !important;
                display: block;
            }

            .hpanel {
                margin-bottom: 12px;
            }
            .select2-container .select2-choice {
                font-size: 14px;
                font-family: inherit;
            }
            .select2-search input {
                font-family: inherit;
            }

            .hr-line-dashed {
                margin: 15px 0;
            }

            .logo {
                /*padding: 18px;*/
            }

            .modal textarea, .textarea, textarea {
                resize: vertical;
            }


            .form-horizontal .control-label {
                padding-top: 8px;
            }

            .nav.navbar-nav li a {
                color: #666;
            }

            .panel-body.active {
                border: none;
            }
            table.text-center th {
                text-align: center;
            }

            .seach-group .col-md-3 {
                margin-bottom: 6px;
            }

            .checkbox input[type="checkbox"] {
                opacity: 1;
            }

            .label {
                padding: .2em .6em .2em;
            }
            .input-group[class*="col-"] {
                float: left;
                padding-right: 15px;
                padding-left: 15px;
            }

            label.is-required:before {
                content: "*";
                color: #e74c3c;
                margin-right: 4px;
                padding-top: 7px;
            }

            .panel-body > .form-group:last-child {
                margin-bottom: 0;
            }
            .p-l-none{
                padding-left: 0;
            }
            .p-r-none{
                padding-left: 0;
            }
            .hpanel .panel-body,.body.light-skin .hpanel .panel-body{
                border-radius:6px !important; ;
            }
            .form-group>div[class*="col-md-"] input.btn-info,.form-group>div[class*="col-md-"] button.btn-info{
                float: right;
            }
            .note-editor{
                border: none;
            }
        </style>
    </head>

    <body class="fixed-navbar fixed-sidebar fixed-footer">


        <!-- <g:set var="currentUser" value="${com.next.User.findByUsername(sec.loggedInUserInfo(field: 'username'))}"/> -->

        
        <div class="splash">
            <div class="color-line"></div>
            <div class="splash-title">
                <h1>Next CRM</h1>
                <div class="spinner">
                    <div class="rect1"></div>
                    <div class="rect2"></div>
                    <div class="rect3"></div>
                    <div class="rect4"></div>
                    <div class="rect5"></div>
                </div>
            </div>
        </div>
    <div id="header">
        <div class="color-line">
        </div>

        <div class="logo light-version">
            <asset:image src="aside-logo.png" height="24" alt="logo"/>
            %{-- <span><a href="javascript:;">Next CRM</a></span> --}%
        </div>
        <nav role="navigation">
            <div class="header-link hide-menu"><i class="fa fa-bars"></i></div>

            <div class="small-logo">
                <span class="text-primary">Next CRM</span>
            </div>

            <div class="mobile-menu">
                <button type="button" class="navbar-toggle mobile-menu-toggle" data-toggle="collapse" style="margin-top:0"
                        data-target="#mobile-collapse">
                    <sec:ifLoggedIn>
                        <asset:image src="defaultAvater.png" class="img-circle" alt="logo" width="32" height="32"/><b
                            class="caret"></b>
                    </sec:ifLoggedIn>
                </button>

                <div class="collapse mobile-navbar" id="mobile-collapse">
                    <ul class="nav navbar-nav new-dropdown">
                        %{--<li><a href="#"><i class="fa fa-edit"></i>更换头像</a></li>--}%
                        <li>
                            <g:link controller="user" action="changePassword">
                                <i class="fa fa-gear"></i>修改口令
                            </g:link>
                        </li>
                        <li>
                            <g:link controller="logoff">
                                <i class="fa fa-sign-out"></i>退出</g:link>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="navbar-right" id="header-right">
                <ul class="nav navbar-nav no-borders">
                  %{--  <li class="dropdown">
                        <a class="dropdown-toggle" href="#" data-toggle="dropdown">
                            <i class="pe-7s-speaker"></i>
                        </a>
                        <ul class="dropdown-menu hdropdown notification animated flipInX">
                            <li>
                                <a>
                                    <span class="label label-success">NEW</span> It is a long established.
                                </a>
                            </li>
                            <li>
                                <a>
                                    <span class="label label-warning">WAR</span> There are many variations.
                                </a>
                            </li>
                            <li>
                                <a>
                                    <span class="label label-danger">ERR</span> Contrary to popular belief.
                                </a>
                            </li>
                            <li class="summary"><a href="#">See all notifications</a></li>
                        </ul>
                    </li>--}%
                    <li class="dropdown">
                        <a class="dropdown-toggle" href="#" data-toggle="dropdown">
                            <i class="pe-7s-keypad"></i>
                        </a>

                        <div class="dropdown-menu hdropdown bigmenu animated flipInX">
                            <table>
                                <tbody>
                                <tr>
                                    <td>
                                        <g:link controller="activity" action="createTask">
                                            <i class="fa fa-calendar-check-o text-info"></i>
                                            <h5>任务</h5>
                                        </g:link>

                                    </td>
                                    <td>
                                        <g:link controller="activity" action="createAppointment">
                                            <i class="fa fa-info-circle text-success"></i>
                                            <h5>预约</h5>
                                        </g:link>
                                    </td>
                                    <td>
                                        <g:link controller="lead" action="create">
                                            <i class="fa fa-info-circle text-warning"></i>
                                            <h5>线索</h5>
                                        </g:link>
                                    </td>


                                </tr>
                                <tr>
                                    <td>
                                        <g:link controller="opportunity" action="create">
                                            <i class="fa fa-tasks text-success"></i>
                                            <h5>商机</h5>
                                        </g:link>

                                    </td>
                                    <td>
                                        <g:link controller="account" action="create">
                                            <i class="fa fa-vcard-o text-danger"></i>
                                            <h5>客户</h5>
                                        </g:link>

                                    </td>
                                    <td>
                                        <g:link controller="contact" action="create">
                                            <i class="fa fa-user-circle text-info"></i>
                                            <h5>联系人</h5>
                                        </g:link>
                                    </td>

                                </tr>
                                <tr>
                                    <td>
                                        <g:link controller="campaign" action="create">
                                            <i class="fa fa-sitemap text-danger"></i>
                                            <h5>市场</h5>
                                        </g:link>
                                    </td>
                                    <td>
                                        <g:link controller="issue" action="create">
                                            <i class="fa fa-deaf text-info"></i>
                                            <h5>反馈</h5>
                                        </g:link>
                                    </td>
                                    <td>
                                        <g:link controller="asset" action="create">
                                            <i class="fa fa-dollar text-success"></i>
                                            <h5>资产</h5>
                                        </g:link>
                                    </td>

                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </li>
                  %{--  <li class="dropdown">
                        <a class="dropdown-toggle label-menu-corner" href="#" data-toggle="dropdown">
                            <i class="pe-7s-mail"></i>
                            <span class="label label-success">4</span>
                        </a>
                        <ul class="dropdown-menu hdropdown animated flipInX">
                            <div class="title">
                                You have 4 new messages
                            </div>
                            <li>
                                <a>
                                    It is a long established.
                                </a>
                            </li>
                            <li>
                                <a>
                                    There are many variations.
                                </a>
                            </li>
                            <li>
                                <a>
                                    Lorem Ipsum is simply dummy.
                                </a>
                            </li>
                            <li>
                                <a>
                                    Contrary to popular belief.
                                </a>
                            </li>
                            <li class="summary"><a href="#">See All Messages</a></li>
                        </ul>
                    </li>--}%
                  %{--  <li>
                        <a href="#" id="sidebar" class="right-sidebar-toggle">
                            <i class="pe-7s-upload pe-7s-news-paper"></i>
                        </a>
                    </li>--}%
                    <li class="dropdown">
                        <g:link controller="logoff">
                            <i class="pe-7s-upload pe-rotate-90"></i></g:link>
                    </li>
                </ul>

                %{-- <ul class="nav navbar-nav no-borders">
                   <sec:ifLoggedIn>
                  <sec:ifNotGranted roles="ROLE_ADMINISTRATOR, ROLE_GENERAL_MANAGER, ROLE_COO ">
                       <li class="dropdown">
                           <a class="dropdown-toggle label-menu-corner" href="#" data-toggle="dropdown">
                               <i class="fa fa-envelope-o"></i>
                               <span class="label label-info">${com.next.OpportunityRole.findAll("from OpportunityRole where user.id = ? and stage.id = opportunity.stage.id and opportunity.status = 'Pending'", [com.next.User.findByUsername(sec.loggedInUserInfo(field: 'username'))?.id])?.size()}</span>
                           </a>
                           <ul class="dropdown-menu hdropdown animated flipInX">
                               <div class="title">
                                   您有<b
                                       class="text-info">${com.next.OpportunityRole.findAll("from OpportunityRole where user.id = ? and stage.id = opportunity.stage.id and opportunity.status = 'Pending'", [com.next.User.findByUsername(sec.loggedInUserInfo(field: 'username'))?.id])?.size()}</b>个代办事项

                               </div>
                               <g:each in="${com.next.OpportunityStage.list()}">
                                   <g:if test="${com.next.OpportunityRole.findAll("from OpportunityRole where user.id = ? and stage.id = opportunity.stage.id and stage.id = ? and opportunity.status = 'Pending'", [com.next.User.findByUsername(sec.loggedInUserInfo(field: 'username'))?.id, it?.id])?.size() > 0}">
                                       <li>
                                           <g:link controller="OpportunityRole" action="searchOpportunity"
                                                   params="[stage: it?.name]">
                                               ${it?.name} (${com.next.OpportunityRole.findAll("from OpportunityRole where user.id = ? and stage.id = opportunity.stage.id and stage.id = ? and opportunity.status = 'Pending'", [com.next.User.findByUsername(sec.loggedInUserInfo(field: 'username'))?.id, it?.id])?.size()})
                                           </g:link>
                                       </li>
                                   </g:if>
                               </g:each>
                           </ul>
                       </li>
                   </sec:ifNotGranted>

                    </sec:ifLoggedIn>--}%
                </ul>
            </div>

        </nav>
    </div>
        <!-- Navigation -->
        <sec:ifLoggedIn>
            <aside id="menu">
                <div id="navigation">
                    <div class="profile-picture">
                        <a href="#">
                            <g:if test="${com.next.User.findByUsername(sec.loggedInUserInfo(field: 'username'))?.avatarUrl}">
                                <img src="${com.next.User.findByUsername(sec.loggedInUserInfo(field: 'username'))?.avatarUrl}" class="img-circle m-b" alt="logo" width="50" height="50"/>
                            </g:if>
                            <g:else>
                                <asset:image src="defaultAvater.png" class="img-circle m-b" alt="logo" width="50" height="50"/>                                
                            </g:else>
                        </a>

                        <div class="stats-label text-color">
                            <div class="dropdown">
                                <a class="font-extra-bold font-uppercase dropdown-toggle" href="#" data-toggle="dropdown">
                                    <small class="text-muted"><sec:loggedInUserInfo field="username"/> <b class="caret"></b></small>
                                </a>
                                <ul class="dropdown-menu animated flipInX m-t-xs">
                                    <li>
                                        <g:link controller="user" action="changePassword">
                                            <i class="fa fa-lg fa-gear"></i>修改口令
                                        </g:link>
                                    </li>
                                    <li>
                                        <g:link controller="user" action="changeAvatar">
                                            <i class="fa fa-lg fa-edit"></i>更换头像
                                        </g:link>
                                    </li>
                                    <li class="divider"></li>
                                    <li>
                                        <g:link controller="logoff">
                                            <i class="fa fa-lg fa-sign-out"></i>退出</g:link>
                                    </li>
                                </ul>
                            </div>
                          %{--  <div id="sparkline1" class="small-chart m-t-sm"><canvas width="119" height="30" style="display: inline-block; width: 119px; height: 30px; vertical-align: top;"></canvas></div>
                            <div>
                                <h4 class="font-extra-bold m-b-xs">
                                    $260 104,200
                                </h4>
                                <small class="text-muted">Your income from the last year in sales product X.</small>
                            </div>--}%
                        </div>
                    </div>
                    <ul class="nav" id="side-menu">
                        <g:if test="${com.next.User.findByUsername(sec.loggedInUserInfo(field: 'username'))?.dynamicMenu}">
                            <g:each in="${this.currentMenus}">
                                <g:if test="${it?.menu?.type == 'Folder'}">
                                    <li>
                                        <a href="#"><span class="nav-label"><i class="${it?.menu?.icon}"></i>${it?.menu?.name}</span><span class="fa arrow"></span></a>
                                        <ul class="nav nav-second-level">
                                            <g:each in="${it?.items}">
                                                <li><a href=${it?.linkUrl}><i class="${it?.icon}"></i>${it?.name}</a></li>
                                            </g:each>
                                        </ul>
                                    </li>
                                </g:if>
                                <g:elseif test="${it?.menu?.type == 'Item'}">
                                    <li><a href=${it?.menu?.linkUrl}><i class="${it?.menu?.icon}"></i>${it?.menu?.name}</a></li>
                                </g:elseif>
                            </g:each>
                        </g:if>
                        <g:else>
                            <sec:ifAnyGranted roles="ROLE_ADMINISTRATOR, ROLE_COMPANY_ADMINISTRATOR, ROLE_COMPANY_USER">
                                <li>
                                    <a href="#"><span class="nav-label"><i class="fa fa-lg fa-fw fa-calendar-check-o"></i>日历</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="activity" action="index">我的日历</g:link></li>
                                        <li><g:link controller="activityTeam" action="index">团队的日历</g:link></li>
                                    </ul>
                                </li>

                                <li>
                                    <a href="#"><span class="nav-label"><i class="fa fa-lg fa-fw fa-info-circle"></i>线索</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="lead" action="index">我的线索</g:link></li>
                                        <li><g:link controller="leadTeam" action="index">团队的线索</g:link></li>
                                    </ul>
                                </li>

                                <li>
                                    <a href="#"><span class="nav-label"><i class="fa fa-lg fa-fw fa-tasks"></i>商机</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="opportunity" action="index">我的商机</g:link></li>
                                        <li><g:link controller="opportunityTeam" action="index">团队的商机</g:link></li>
                                    </ul>
                                </li>

                                <li>
                                    <a href="#"><span class="nav-label"><i class="fa fa-lg fa-fw fa-vcard-o"></i>客户</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="account" action="index">我的客户</g:link></li>
                                        <li><g:link controller="accountTeam" action="index">团队的客户</g:link></li>
                                    </ul>
                                </li>

                                <li>
                                    <a href="#"><span class="nav-label"><i class="fa fa-lg fa-fw fa-user-circle"></i>联系人</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="contact" action="index">我的联系人</g:link></li>
                                        <li><g:link controller="contactTeam" action="index">团队的联系人</g:link></li>
                                    </ul>
                                </li>

                                <li>
                                    <a href="#"><span class="nav-label"><i class="fa fa-lg fa-fw fa-sitemap"></i>市场活动</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="campaign" action="index">我的市场活动</g:link></li>
                                        <li><g:link controller="campaignTeam" action="index">我参与的市场活动</g:link></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#"><span class="nav-label"><i class="fa fa-lg fa-fw fa-deaf"></i>反馈</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="issue" action="index">反馈</g:link></li>
                                        <li><g:link controller="issueTeam" action="index">团队反馈</g:link></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#"><span class="nav-label"><i class="fa fa-lg fa-fw fa-dollar"></i>资产</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="asset" action="index">资产</g:link></li>
                                        <li><g:link controller="assetTeam" action="index">团队资产</g:link></li>
                                    </ul>
                                </li>

                                <li><g:link controller="contract" action="index"><i class="fa fa-lg fa-fw fa-file-archive-o"></i>合同</g:link></li>
                                <li>
                                    <a href="#"><span class="nav-label "><i class="fa fa-lg fa-fw fa-product-hunt"></i>产品</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="productLine" action="index">产品线</g:link></li>
                                        <li><g:link controller="product" action="index">产品</g:link></li>
                                    </ul>
                                </li>
                            </sec:ifAnyGranted>
                            <sec:ifAnyGranted roles="ROLE_ADMINISTRATOR, ROLE_COMPANY_ADMINISTRATOR">
                                <li>
                                    <a href="#"><span class="nav-label"><i class="fa fa-lg fa-fw fa-user-circle-o"></i>人事</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="department" action="index">部门</g:link></li>
                                        <li><g:link controller="position" action="index">岗位</g:link></li>
                                        <li><g:link controller="job" action="index">职位</g:link></li>
                                        <li><g:link controller="employee" action="index">员工</g:link></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#"><span class="nav-label "><i class="fa fa-lg fa-fw fa-table"></i>区域</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="territory" action="index">区域</g:link></li>
                                        <li><g:link controller="country" action="index">国家</g:link></li>
                                        <li><g:link controller="province" action="index">省份</g:link></li>
                                        <li><g:link controller="city" action="index">城市</g:link></li>
                                        <li><g:link controller="district" action="index">市区</g:link></li>
                                        <li><g:link controller="address" action="index">单位</g:link></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#"><span class="nav-label "><i class="fa fa-lg fa-fw fa-database"></i>字典</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="causeOfFailure" action="index">商机失败原因</g:link></li>
                                        <li><g:link controller="opportunityStage" action="index">商机阶段</g:link></li>
                                        <li><g:link controller="addressType" action="index">地址类型</g:link></li>
                                        <li><g:link controller="accountLevel" action="index">客户分级</g:link></li>
                                        <li><g:link controller="contactLevel" action="index">联系人分级</g:link></li>
                                        <li><g:link controller="opportunityType" action="index">商机类型</g:link></li>
                                        <li><g:link controller="opportunityStatus" action="index">商机状态</g:link></li>
                                        <li><g:link controller="contractType" action="index">合同类型</g:link></li>
                                        <li><g:link controller="contractStatus" action="index">合同状态</g:link></li>
                                        <li><g:link controller="campaignType" action="index">市场活动类型</g:link></li>
                                        <li><g:link controller="campaignStatus" action="index">市场活动状态</g:link></li>
                                        <li><g:link controller="issueType" action="index">反馈类型</g:link></li>
                                        <li><g:link controller="issueReason" action="index">反馈原因</g:link></li>
                                        <li><g:link controller="issueStatus" action="index">反馈状态</g:link></li>
                                        <li><g:link controller="issueOrigin" action="index">反馈来源</g:link></li>
                                        <li><g:link controller="issuePriority" action="index">反馈优先级</g:link></li>
                                        <li><g:link controller="assetStatus" action="index">资产状态</g:link></li>
                                        <li><g:link controller="contactType" action="index">联系人类型</g:link></li>
                                        <li><g:link controller="purchasingMethod" action="index">采购方法</g:link></li>
                                        <li><g:link controller="activitySubtype" action="index">活动子类型</g:link></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#"><span class="nav-label"><i class="fa fa-lg fa-fw fa-gear"></i>权限</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="role" action="index">角色</g:link></li>
                                        <li><g:link controller="securityProfile" action="index">安全配置</g:link></li>
                                        <li><g:link controller="Menu" action="index">菜单</g:link></li>
                                        <li><g:link controller="user" action="index">用户</g:link></li>
                                        <li><g:link controller="company" action="index">公司</g:link></li>
                                        <li><g:link controller="loginHistory" action="index">登录明细</g:link></li>
                                    </ul>
                                </li>
                            </sec:ifAnyGranted>
                            <sec:ifAnyGranted roles="ROLE_ADMINISTRATOR">
                                <li>
                                    <a href="#"><span class="nav-label"><i class="fa fa-lg fa-fw fa-cogs"></i>系统</span><span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li><g:link controller="productOpportunityStage" action="index">产品阶段</g:link></li>
                                        <li><g:link controller="messageTemplate" action="index">消息推送</g:link></li>
                                        <li><g:link controller="message" action="index">消息</g:link></li>
                                        <li><g:link controller="document" action="index">帮助文档</g:link></li>
                                        <li><g:link controller="externalDataMapping" action="index">外部数据映射</g:link></li>
                                        <li><g:link controller="ExternalDataReceiver" action="index">外部数据接收</g:link></li>
                                        <li><g:link controller="timingTask" action="index">定时任务</g:link></li>
                                        <li><g:link controller="flexFieldCategory" action="index">弹性域</g:link></li>
                                        <li><g:link controller="Workflow" action="index">工作流</g:link></li>
                                        <li><g:link controller="component" action="index">组件</g:link></li>
                                    </ul>
                                </li>
                            </sec:ifAnyGranted>
                        </g:else>
                    </ul>
                </div>
            </aside>
        </sec:ifLoggedIn>
        <div id="wrapper">
            <g:layoutBody/></div>

        <asset:javascript src="homer/vendor/sparkline/index.js" />
        <asset:javascript src="homer/vendor/slimScroll/jquery.slimscroll.min.js" />
        <asset:javascript src="homer/vendor/jquery-ui/jquery-ui.min.js" />
        <asset:javascript src="homer/vendor/bootstrap/dist/js/bootstrap.min.js" />
        <asset:javascript src="homer/vendor/jquery-validation/jquery.validate.min.js" />
        <asset:javascript src="homer/vendor/metisMenu/metisMenu.min.js" />
        <asset:javascript src="homer/vendor/sweetalert/lib/sweet-alert.min.js" />
        <asset:javascript src="homer/vendor/select2-3.5.2/select2.min.js" />
        <asset:javascript src="homer/vendor/select2-3.5.2/zh-CN.js" />
        <asset:javascript src="homer/vendor/iCheck/icheck.min.js" />
        <asset:javascript src="homer/vendor/highlight/highlight.pack.js" />
        <asset:javascript src="homer/vendor/datetimepicker/bootstrap-datetimepicker.min.js" />
        <asset:javascript src="homer/vendor/datetimepicker/bootstrap-datetimepicker.zh-CN.js" />
        <asset:javascript src="homer/vendor/summernote/summernote.min.js" />
        <asset:javascript src="homer/vendor/toastr/toastr.min.js" />

        <asset:javascript src="homer/vendor/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js" />
        <asset:javascript src="homer/homer.js" />
    <script>
            $(function() {
                toastr.options = {
                    "closeButton": true,
                    "debug": false,
                    "progressBar": false,
                    "positionClass": "toast-top-center",
                    "onclick": null,
                    "showDuration": "300",
                    "hideDuration": "1000",
                    "timeOut": "5000",
                    "extendedTimeOut": "1000",
                    "showEasing": "swing",
                    "hideEasing": "linear",
                    "showMethod": "fadeIn",
                    "hideMethod": "fadeOut"
                }
                $.each($(".errors li"), function (i, obj) {
                    toastr.warning($(obj).text().trim());
                });



                // Initialize metsiMenu plugin to sidebar menu
                $('#side-menu').metisMenu();

                // Initialize iCheck plugin
                $('.i-checks').iCheck({
                    checkboxClass: 'icheckbox_square-green',
                    radioClass: 'iradio_square-green'
                });

                $(".integer").TouchSpin({
                    verticalbuttons: true,
                    min: 0,
                    max: 100000000000
                });

                function formatCellphone(cellphone) {
                    if (typeof cellphone == 'number') {
                        cellphone = cellphone.toString();
                    }
                    return cellphone.substr(0, 3) + '****' + cellphone.substr(7, 11);
                }

                $.each($(".cellphoneFormat"),
                    function(i, obj) {
                        if ($(obj).text().trim()) {
                            $(obj).text(formatCellphone($(obj).text().trim()));
                        }
                    });
                $.each($(".cellphoneFormat2"),
                    function(i, obj) {
                        if ($(obj).val().trim()) {
                            $(obj).val(formatCellphone($(obj).val().trim()));
                        }

                    });
                //        折叠
                $(".collapsed .showhide").click(function() {
                    $(this).parent().parent().toggleClass("hbuilt");
                    $(this).parent().parent().parent().toggleClass("panel-collapse");
                });
                $("select").select2();
                //        代码高亮
                hljs.initHighlightingOnLoad();
                //删除数据
                $(document).delegate(".deleteBtn", "click",
                    function() {
                        var currentForm = $(this).parent("form");
                        swal({
                                title: "您确认删除该数据吗?",
                                type: "warning",
                                showCancelButton: true,
                                confirmButtonColor: "#DD6B55",
                                cancelButtonText: "取消",
                                confirmButtonText: "删除",
                                closeOnConfirm: false,
                                closeOnCancel: true

                            },
                            function(isConfirm) {
                                if (isConfirm) {
                                    currentForm.submit();

                                }
                            });

                    });
            });
            //    日期插件
            $('.form_datetime').datetimepicker({
                minView: "day",
                //选择日期后，不会再跳转去选择时分秒
                format: "yyyy-mm-dd hh:00:00",
                //选择日期后，文本框显示的日期格式
                language: 'zh-CN',
                //汉化
                autoclose: true //选择日期后自动关闭
            });
            $('.form_endtime').datetimepicker({
                minView: "month",
                //选择日期后，不会再跳转去选择时分秒
                format: "yyyy-mm-dd 23:59:59",
                //选择日期后，文本框显示的日期格式
                language: 'zh-CN',
                //汉化
                autoclose: true //选择日期后自动关闭
            });
            //    $(".table-responsive").parent(".panel-body").addClass("active");
        </script>
    </body>

</html>
